package com.yellowpage.ca.data;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.SequenceGenerator;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.GenericGenerator;

/**
 * UserLoginHistory generated by hbm2java
 */
@Entity
@Table(name = "CA_USER_LOGIN_HISTORY")

public class UserLoginHistory implements java.io.Serializable {

	private long loginHistoryId;
	private User user;
	private Date loginTime;

	public UserLoginHistory() {
	}

	public UserLoginHistory(long loginHistoryId) {
		this.loginHistoryId = loginHistoryId;
	}
	public UserLoginHistory(long loginHistoryId, User user, Date loginTime) {
		this.loginHistoryId = loginHistoryId;
		this.user = user;
		this.loginTime = loginTime;
	}

	@GenericGenerator(name = "generator", strategy = "identity")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "LOGIN_HISTORY_ID", unique = true, nullable = false, precision = 18, scale = 0)
	public long getLoginHistoryId() {
		return this.loginHistoryId;
	}

	public void setLoginHistoryId(long loginHistoryId) {
		this.loginHistoryId = loginHistoryId;
	}
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "USER_ID")
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "LOGIN_TIME", length = 7)
	public Date getLoginTime() {
		return this.loginTime;
	}

	public void setLoginTime(Date loginTime) {
		this.loginTime = loginTime;
	}

}
